package com.rsstuan.web.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.rsstuan.storage.impl.JDOTuanGouItemStorage;

public class UserOperationController extends SpringController{
	
	private JDOTuanGouItemStorage itemStorage = new JDOTuanGouItemStorage();
	
	public ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse response) throws IOException {
		String idStr = request.getParameter("id");
		String link = request.getParameter("link");
		if (idStr != null && link != null) {
			try {
				//Long id = Long.parseLong(idStr);
				//itemStorage.addClick(id, 1);
			}
			finally {
			    response.setStatus(200);
			    response.sendRedirect(link);
			}
			return null;
		}
		response.sendRedirect("index.do");
		return null;
	}
}
